﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CinemaBookingUI.WCFReference;

namespace CinemaBookingUI
{
    public class SingletonWCF
    {
        private static SingletonWCF instance = null;

        /// <summary>
        /// Constructor
        /// </summary>
        private SingletonWCF() {}
        /// <summary>
        /// Property
        /// </summary>
        public static SingletonWCF Instance
        {
            get
            {
                if (instance == null)
                {
                    instance = new SingletonWCF();   
                }
                return instance;
            }
        }

        //Methods
        public WCFReference.IWcfCinemaService WCFNetTcp()
        {
            return new WCFReference.WcfCinemaServiceClient("netTcpBinding");
        }
        public WCFReference.IWcfCinemaService WCFHttp()
        {
            return new WCFReference.WcfCinemaServiceClient("httpBinding");
        }
    }
}
